import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import local_get from '@dfeidao/atom-web/local/get';
import fire_to from '@dfeidao/atom-web/msg/fire';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import error from '@dfeidao/atom-web/msgbox/error';
import success from '@dfeidao/atom-web/msgbox/success';
// import whoami from '@dfeidao/atom-web/msg/whoami';
import storage_get from '@dfeidao/atom-web/storage/get';
import a002 from './a002';
// 删除
export default async function a003(fd: IFeidaoAiBrowserComponent) {
	const formid = local_get(fd, "formid");
	// const user = await whoami();
	const prid = storage_get('productid');
	const res = await nodejs('function-definition/zj-000007/s001', { formid, productid: prid });
	if (res === "fail") {
		error("删除失败");
	}
	if (res === "success") {
		success("删除成功");
		fire_to('zj-000001', 'a002');
		await a002(fd);
	}
}
